import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

import Layout from '@/layout/Index.vue'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        component: Layout,
        redirect: '/dashboard',
        children: [
            {
                path: '/dashboard',
                component: () => import('@/layout/dashboard/Index.vue'),
                name: 'dashboard',
                meta: {
                    title: '首页'
                }
            },
            {
                path: '/superback',
                component: () => import('@/layout/dashboard/SuperBack.vue'),
                name: 'superback',
                meta: {
                    title: '返回'
                }
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/Login.vue')
    },
    {
        path: '/install',
        name: 'install',
        component: () => import('@/views/login/Install.vue')
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router
